
package Biblioteca;

/**
 *
 * @author Guilherme Silva Gomes
 * @author Ténico em informática - Semestre 2 (noite)
 * 
 */

import java.util.*;


public class Revista extends Publicacao implements Comparable, Comparator {
    private int volume;
    private int numEdicao;
    private String dataEdicao; // Deverá ser no formato mm/aaaa

    
    public Revista(int volume, int numEdicao, String dataEdicao, String codigo, String titulo, String autor, String editora) {
        super(codigo, titulo, autor, editora);
        this.volume = volume;
        this.numEdicao = numEdicao;
        this.dataEdicao = dataEdicao;
    }

    @Override
    public String toString() {
        return "Revista{" + "volume=" + volume + ", numEdicao=" + numEdicao + ", dataEdicao=" + dataEdicao + '}';
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Revista other = (Revista) obj;
        if (this.volume != other.volume) {
            return false;
        }
        if (this.numEdicao != other.numEdicao) {
            return false;
        }
        if (this.dataEdicao == null ? other.dataEdicao != null : !this.dataEdicao.equals(other.dataEdicao)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + this.volume;
        hash = 29 * hash + this.numEdicao;
        hash = 29 * hash + (this.dataEdicao != null ? this.dataEdicao.hashCode() : 0);
        return hash;
    }

    @Override
    public int compareTo(Object o) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int compare(Object o1, Object o2) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public String getDataEdicao() {
        return dataEdicao;
    }

    public void setDataEdicao(String dataEdicao) {
        this.dataEdicao = dataEdicao;
    }

    public int getNumEdicao() {
        return numEdicao;
    }

    public void setNumEdicao(int numEdicao) {
        this.numEdicao = numEdicao;
    }

    public int getVolume() {
        return volume;
    }

    public void setVolume(int volume) {
        this.volume = volume;
    }


}
